<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>日值班表</title>
    <link rel="stylesheet" href="../css/H-ui.min.css">
    <link rel="stylesheet" href="../css/bootstrap.min.css">
    <link rel="stylesheet" href="../css/bootstrap-datetimepicker.min.css">
    <style type="text/css">
        /*所有内容都在这个DIV内*/
        div.all {
            border: 1px solid gray;
            width: 80%; /*这个宽度可根据实际需要改变*/
            clear: right;
        }

        /*表头在这个DIV内*/
        div.title {
            width: 100%;
        }
        /*内容在这个DIV内*/
        div.content {
            width: 100%;
            overflow: scroll;  /*总是显示滚动条*/
            overflow-x: hidden; /*去掉横向滚动条*/
            height: 450px;
        }
        div.title_left {
            float: left;
            margin-right: 17px;
        }
        div.content_left {
            float: left;
        }

        .main_table {
            width: 100%;
            border: 1px solid gray;
            border-collapse: collapse;  /*边线与旁边的合并*/
            table-layout:fixed;
        }
        .main_table tr th {
            border: 1px solid gray;
            overflow: hidden;  /*超出长度的内容不显示*/
            /*word-wrap: break-word;  内容将在边界内换行,这里显示省略号,所以不需要了*/
            word-break: break-all;  /*字内断开*/
            text-overflow: ellipsis;  /*当对象内文本溢出时显示省略标记（…），省略标记插入的位置是最后一个字符*/
            white-space: nowrap;
            text-align: center;
        }
        /*单元格样式*/
        .main_table tr td {
            border: 1px solid gray;
            height: 60px ;
            overflow: hidden;
            /*word-wrap: break-word;  内容将在边界内换行,这里显示省略号,所以不需要了*/
            word-break: break-all;
            text-overflow: ellipsis;
            white-space: nowrap;
            text-align: center;
        }
    </style>
</head>
<body ng-app="dutyScheduleDayApp">
<div style="float: left;width: 80%">
<div id="divId1" style="height: 60px;background-color: #F8F8F8;width: 100%;">
    <a href='../html/dutySchedule.html'><img id="u750" style="float: right;vertical-align: middle;margin-right: 10px" src="../images/u750.png"></a>
</div>
<div id="divId2" style="height: 46px;width: 100%;margin-top: 10px;text-align: center">
    <img onclick="preMonth()" style="float: left;vertical-align: middle;margin-left: 10px;width: 22px;height: 25px;cursor:pointer" src="../images/arrow-left.png">
    <input id="bnt1" style="border:2px solid darkgray ;float: left;margin-left: 10px; background-color:white;width: 50px;height: 25px" name="bnt1" type="button" value="今天" />
    <input type="text" style="width: 100px;font-size: larger;cursor:pointer" class="form_datetime_2 input-text radius size-S borderNone text-c"  id="month_time" value=""/>
    <img style="vertical-align: middle;"  src="../images/riqi.png">

    <span class="add-on">
        <i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
    </span>
    <!--<span style="color:black;font-weight:bold;font-size:26px">December 2016</span>-->
    <img onclick="nextMonth()" style="float: right;vertical-align: middle;margin-right: 10px;width: 22px;height: 25px;cursor:pointer" src="../images/arrow-right.png">
</div>
<div style="width: 100%;height: 100%;text-align: center" ng-controller="dutyScheduleDayCtrl">
    <div class="all" style="width: 100%;height: 100%;">
        <div class="title">
            <div class="title_left">
                <table class="main_table" style="height: 40px;text-align: center">
                    <tr style="text-align: center">
                        <th style="width: 80px;"></th>
                        <th>周一 <span ng-bind="dayOne"></span></th>
                        <th>周二 <span ng-bind="dayTwo"></span></th>
                        <th>周三 <span ng-bind="dayThree"></span></th>
                        <th>周四 <span ng-bind="dayFour"></span></th>
                        <th>周五 <span ng-bind="dayFive"></span></th>
                        <th>周六 <span ng-bind="daySix"></span></th>
                        <th>周日 <span ng-bind="daySeven"></span></th>
                    </tr>
                </table>
            </div>
        </div>
        <div class="content">
            <div class="content_left">
                <table class="main_table">
                    <tr>
                        <td style="width: 80px;cursor: pointer" ng-click="layerShow()"><span>allDay</span></td>
                        <td style="cursor: pointer" ng-click="layerShow(1)"></td>
                        <td style="cursor: pointer" ng-click="layerShow(2)"></td>
                        <td style="cursor: pointer" ng-click="layerShow(3)"></td>
                        <td style="cursor: pointer" ng-click="layerShow(4)"></td>
                        <td style="cursor: pointer" ng-click="layerShow(5)"></td>
                        <td style="cursor: pointer" ng-click="layerShow(6)"></td>
                        <td style="cursor: pointer" ng-click="layerShow(7)"></td>
                    </tr>
                    <tr>
                        <td style="width: 80px;">8am</td>
                        <td>
                           <div style="background-color: #F7F7F7;height: 550px;width: 60px;position: absolute">
                                <h6 ng-repeat="item in day1List.normal">
                                    <span ng-bind="item.person.name"></span>
                                </h6>
                           </div>
                        </td>
                        <td>
                           <div style="background-color: #F7F7F7;height: 550px;width: 60px;position: absolute">
                                <h6 ng-repeat="item in day2List.normal">
                                    <span ng-bind="item.person.name"></span>
                                </h6>
                           </div>
                        </td>
                        <td>
                           <div style="background-color: #BFEFFF;height: 550px;width: 60px;position: absolute">
                                <h6 ng-repeat="item in day3List.normal">
                                    <span ng-bind="item.person.name"></span>
                                </h6>
                           </div>
                        </td>
                        <td>
                           <div style="background-color: #FFFACD;height: 550px;width: 60px;position: absolute">
                                <h6 ng-repeat="item in day4List.normal">
                                    <span ng-bind="item.person.name"></span>
                                </h6>
                           </div>
                        </td>
                        <td>
                           <div style="background-color: #FFFACD;height: 550px;width: 60px;position: absolute">
                                <h6 ng-repeat="item in day5List.normal">
                                    <span ng-bind="item.person.name"></span>
                                </h6>
                           </div>
                        </td>
                        <td>
                           <div style="background-color: #FFFACD;height: 550px;width: 60px;position: absolute">
                                <h6 ng-repeat="item in day6List.normal">
                                    <span ng-bind="item.person.name"></span>
                                </h6>
                           </div>
                        </td>
                        <td>
                           <div style="background-color: #FFFACD;height: 550px;width: 60px;position: absolute">
                                <h6 ng-repeat="item in day7List.normal">
                                    <span ng-bind="item.person.name"></span>
                                </h6>
                           </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 80px;">9am</td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                    </tr>
                    <tr>
                        <td style="width: 80px;">10am</td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                    </tr>
                    <tr>
                        <td style="width: 80px;">11am</td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                    </tr>
                    <tr>
                        <td style="width: 80px;">12am</td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                    </tr>
                    <tr>
                        <td style="width: 80px;">13pm</td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                    </tr>
                    <tr>
                        <td style="width: 80px;">14pm</td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                    </tr>
                    <tr>
                        <td style="width: 80px;">15pm</td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                    </tr>
                    <tr>
                        <td style="width: 80px;">16pm</td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                    </tr>
                    <tr>
                        <td style="width: 80px;">17pm</td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                    </tr>
                    <tr>
                        <td style="width: 80px;">18pm</td>
                        <td>
                           <div style="background-color: #DBDBDB;height: 300px;width: 60px;position: absolute;margin-left: 30px">
                                <h6 ng-repeat="item in day1List.evening">
                                </h6>
                           </div>
                        </td>
                        <td>
                           <div style="background-color: #DBDBDB;height: 300px;width: 60px;position: absolute;margin-left: 30px">
                                <h6 ng-repeat="item in day2List.evening">
                                </h6>
                           </div>
                        </td>
                        <td>
                           <div style="background-color: #7EC0EE;height: 300px;width: 60px;position: absolute;margin-left: 30px">
                                <h6 ng-repeat="item in day3List.evening">
                                </h6>
                           </div>
                        </td>
                        <td>
                           <div style="background-color: #FFE4B5;height: 300px;width: 60px;position: absolute;margin-left: 30px">
                                <h6 ng-repeat="item in day4List.evening">
                                </h6>
                           </div></td>
                        <td>
                           <div style="background-color: #FFE4B5;height: 300px;width: 60px;position: absolute;margin-left: 30px">
                                <h6 ng-repeat="item in day5List.evening">
                                </h6>
                           </div>
                        </td>
                        <td>
                           <div style="background-color: #FFE4B5;height: 300px;width: 60px;position: absolute;margin-left: 30px">
                                <h6 ng-repeat="item in day6List.evening">
                                </h6>
                           </div>
                        </td>
                        <td>
                           <div style="background-color: #FFE4B5;height: 300px;width: 60px;position: absolute;margin-left: 30px">
                                <h6 ng-repeat="item in day7List.evening">
                                </h6>
                           </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 80px;">19pm</td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                    </tr>
                    <tr>
                        <td style="width: 80px;">20pm</td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                    </tr>
                    <tr>
                        <td style="width: 80px;">21pm</td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                    </tr>
                    <tr>
                        <td style="width: 80px;">22pm</td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                    </tr>
                    <tr>
                        <td style="width: 80px;">23pm</td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                    </tr>
                    <tr>
                        <td style="width: 80px;">0am</td>
                        <td>
                           <div style="background-color: #A9A9A9;height: 450px;width: 60px;position: absolute;margin-left: 50px">
                                <h6 ng-repeat="item in day1List.early">
                                </h6>
                           </div>
                        </td>
                        <td>
                           <div style="background-color: #A9A9A9;height: 450px;width: 60px;position: absolute;margin-left: 50px">
                                <h6 ng-repeat="item in day2List.early">
                                </h6>
                           </div>
                        </td>
                        <td>
                           <div style="background-color: #1E90FF;height: 450px;width: 60px;position: absolute;margin-left: 50px">
                                <h6 ng-repeat="item in day3List.early">
                                </h6>
                           </div>
                        </td>
                        <td>
                           <div style="background-color: #FFD700;height: 450px;width: 60px;position: absolute;margin-left: 50px">
                                <h6 ng-repeat="item in day4List.early">
                                </h6>
                           </div>
                        </td>
                        <td>
                           <div style="background-color: #FFD700;height: 450px;width: 60px;position: absolute;margin-left: 50px">
                                <h6 ng-repeat="item in day5List.early">
                                </h6>
                           </div>
                        </td>
                        <td>
                           <div style="background-color: #FFD700;height: 450px;width: 60px;position: absolute;margin-left: 50px">
                                <h6 ng-repeat="item in day6List.early">
                                </h6>
                           </div>
                        </td>
                        <td>
                           <div style="background-color: #FFD700;height: 450px;width: 60px;position: absolute;margin-left: 50px">
                                <h6 ng-repeat="item in day7List.early">
                                </h6>
                           </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 80px;">1am</td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                    </tr>
                    <tr>
                        <td style="width: 80px;">2am</td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                    </tr>
                    <tr>
                        <td style="width: 80px;">3am</td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                    </tr>
                    <tr>
                        <td style="width: 80px;">4am</td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                    </tr>
                    <tr>
                        <td style="width: 80px;">5am</td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                    </tr>
                    <tr>
                        <td style="width: 80px;">6am</td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                    </tr>
                    <tr>
                        <td style="width: 80px;">7am</td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                        <td></td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
</div>
</div>
<div style="float: left;width: 18.5%;height: 600px;border: 1px solid gray;margin: 8px;">
    <div style="height: 110px;border-bottom: 1px solid gray">
        <div>
           <table>
               <thead>
               <th style="width: 30px;"></th>
               <th style="width: 45px;"></th>
               <th>过去</th>
               <th>当天</th>
               <th>未来</th>
               </thead>
               <tbody>
               <tr style="height: 30px;">
                   <td style="width: 30px;">注：</td>
                   <td style="width: 45px;">正常班</td>
                   <td><div style="background-color: #F7F7F7;width:30px;min-height: 15px;"></div></td>
                   <td><div style="background-color: #BFEFFF;width:30px;min-height: 15px;"></div></td>
                   <td><div style="background-color: #FFFACD;width:30px;min-height: 15px;"></div></td>
               </tr>
               <tr style="height: 30px;">
                   <td style="width: 30px;"></td>
                   <td style="width: 45px;">早班</td>
                   <td><div style="background-color: #DBDBDB;width:30px;min-height: 15px;"></div></td>
                   <td><div style="background-color: #7EC0EE;width:30px;min-height: 15px;"></div></td>
                   <td><div style="background-color: #FFE4B5;width:30px;min-height: 15px;"></div></td>
               </tr>
               <tr style="height: 30px;">
                   <td style="width: 30px;"></td>
                   <td style="width: 45px;">晚班</td>
                   <td><div style="background-color: #A9A9A9;width:30px;min-height: 15px;"></div></td>
                   <td><div style="background-color: #1E90FF;width:30px;min-height: 15px;"></div></td>
                   <td><div style="background-color: #FFD700;width:30px;min-height: 15px;"></div></td>
               </tr>
               </tbody>
           </table>
        </div>

    </div>
    <div style="overflow-y: auto">
        <div style="margin: 10px;"><p>值班人员</p></div>
        <div style="width: 100%;min-height: 150px">
            <div style="margin: 10px;"><p>正常班（8：00 - 17：00）</p></div>
            <div ng-repeat="item in clickDateList.normal" style="margin-left: 10px;width: 60px;float: left">
                 <input type="radio" value="true" checked>
                 <span>赵程委</span>
            </div>
        </div>
        <div style="width: 100%;min-height: 150px;">
            <div style="margin: 10px;"><p>早班（0：00 - 7：00）</p></div>
            <div ng-repeat="item in clickDateList.early" style="margin-left: 10px;margin-bottom:10px;width: 60px;float: left">
                 <input type="radio" value="true" checked>
                 <span>赵程委</span>
            </div>
        </div>
        <div style="width: 100%;min-height: 150px;">
            <div style="margin: 10px;"><p>晚班（18：00 - 23：00）</p></div>
            <div ng-repeat="item in clickDateList.evening" style="margin-left: 10px;width: 60px;float: left">
                 <input type="radio" value="true" checked>
                 <span>赵程委</span>
            </div>
        </div>
    </div>
</div>
<script src="../js/angular.min.js"></script>
<script src="../js/jquery.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/bootstrap-datetimepicker.min.js"></script>
<script src="../js/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="../js/layer.js"></script>
<script src="../js/jquery.params.js"></script>
<script>
    //图片垂直居中
    window.onload=function(){
        var img = document.getElementById("u750");
        var div = document.getElementById("divId1");
        var marginTop = div.offsetHeight - img.height;
        img.style.marginTop = (marginTop/2) + "px";
    };
    //日期控件
    $(".form_datetime_2").datetimepicker({
        language:  'zh-CN',
        format: 'yyyy-mm',
        autoclose: true,
        todayBtn: false,
        startView: 'year',
        minView:'year',
        maxView:'decade',
        bootcssVer:3
    }).on('changeDate', function(ev){
        console.log(ev);
        var val = ev.date.valueOf();
        var unixTimestamp = new Date( val ) ;
        commonTime = unixTimestamp.toLocaleString();
        alert(commonTime);
    });
    //上个月
    function preMonth() {
        var date = document.getElementById("month_time").value;
        var year = date.substring(0,4);
        var month = date.substring(5,7);
        if(month == "01"){
            year = parseInt(year)-1;
            month = "12";
            var nextDate = year+"-"+month;
            $("#month_time").val(nextDate);
        }else{
            month = parseInt(month)-1;
            if(month<10){
                month = "0"+month;
            }
            var nextDate = year+"-"+month;
            $("#month_time").val(nextDate);
        }
    }
    //下个月
    function nextMonth() {
        var date = document.getElementById("month_time").value;
        var year = date.substring(0,4);
        var month = date.substring(5,7);
        if(month == "12"){
            year = parseInt(year)+1;
            month = "01";
            var nextDate = year+"-"+month;
            $("#month_time").val(nextDate);
        }else{
            month = parseInt(month)+1;
            if(month<10){
                month = "0"+month;
            }
            var nextDate = year+"-"+month;
            $("#month_time").val(nextDate);
        }

    }
    //angular post请求头
    var transform = function(data) {
		return $.param(data);
	}, postCfg = {
		headers : {
			'Content-Type' : 'application/x-www-form-urlencoded; charset=UTF-8'
		},
		transformRequest : transform
	};
    var app = angular.module('dutyScheduleDayApp',[])
         app.controller('dutyScheduleDayCtrl',function ($scope, $http) {
             var date = new Date();
             var year = date.getFullYear();
             var month = date.getMonth()+1;
             var day = date.getDate();
             var currentTime = year+"-"+month;
             $("#month_time").val(currentTime);
             //格式化时间
             Date.prototype.format = function (format) { 
				var o = { 
				"M+": this.getMonth() + 1, //month 
				"d+": this.getDate(), //day 
				"h+": this.getHours(), //hour 
				"m+": this.getMinutes(), //minute 
				"s+": this.getSeconds(), //second 
				"q+": Math.floor((this.getMonth() + 3) / 3), //quarter 
				"S": this.getMilliseconds() //millisecond 
				} 
				if (/(y+)/.test(format)) format = format.replace(RegExp.$1, 
				(this.getFullYear() + "").substr(4 - RegExp.$1.length)); 
				for (var k in o) if (new RegExp("(" + k + ")").test(format)) 
				format = format.replace(RegExp.$1, 
				RegExp.$1.length == 1 ? o[k] : 
				("00" + o[k]).substr(("" + o[k]).length)); 
				return format; 
			 } 
             //早中晚班数据请求
             function getDataList(date){
            	 var data = {'checkDate':date};
                 $http.post('/watchArrangements/findByDate',data,postCfg)
            	      .success(function(data){
            	    	  var returnData = data;
            	      });
             }
             //根据日期获取一周
             function days(data) {
                 var yy = data.substring(0,4);
                 var mm = data.substr(5,2);
                 var dd = data.substring(data.length-2);
                 var datas = yy+"/"+mm+"/"+dd;
                 var now = new Date(datas);
                 var nowTime = now.getTime() ;
                 var day = now.getDay();
                 var oneDayLong = 24*60*60*1000 ;
                 var MondayTime = nowTime - (day-1)*oneDayLong  ;
                 var TuesdayTime = nowTime - (day-2)*oneDayLong  ;
                 var WensdayTime = nowTime - (day-3)*oneDayLong  ;
                 var ThusdayTime = nowTime - (day-4)*oneDayLong  ;
                 var FirdayTime = nowTime - (day-5)*oneDayLong  ;
                 var StadayTime = nowTime - (day-6)*oneDayLong  ;
                 var SundayTime =  nowTime + (7-day)*oneDayLong ;
                 var monday = new Date(MondayTime);
                 var tuesday = new Date(TuesdayTime);
                 var wensday = new Date(WensdayTime);
                 var thusday = new Date(ThusdayTime);
                 var friday = new Date(FirdayTime);
                 var stasday = new Date(StadayTime);
                 var sunday = new Date(SundayTime);
                 //格式化为yyyy-mm-dd
                 $scope.day1 = monday.format("yyyy-MM-dd");
                 $scope.day2 = tuesday.format("yyyy-MM-dd");
                 $scope.day3 = wensday.format("yyyy-MM-dd");
                 $scope.day4 = thusday.format("yyyy-MM-dd");
                 $scope.day5 = friday.format("yyyy-MM-dd");
                 $scope.day6 = stasday.format("yyyy-MM-dd");
                 $scope.day7 = sunday.format("yyyy-MM-dd");
                 //表格显示的时间
                 $scope.dayOne = $scope.day1.substr(5,2)+"/"+$scope.day1.substr(8,2);
                 $scope.dayTwo = $scope.day2.substr(5,2)+"/"+$scope.day2.substr(8,2);
                 $scope.dayThree = $scope.day3.substr(5,2)+"/"+$scope.day3.substr(8,2);
                 $scope.dayFour = $scope.day4.substr(5,2)+"/"+$scope.day4.substr(8,2);
                 $scope.dayFive = $scope.day5.substr(5,2)+"/"+$scope.day5.substr(8,2);
                 $scope.daySix = $scope.day6.substr(5,2)+"/"+$scope.day6.substr(8,2);
                 $scope.daySeven = $scope.day7.substr(5,2)+"/"+$scope.day7.substr(8,2);
                 //获取周一数据
                 $http.post('/watchArrangements/getDayArrange',{'checkDate':$scope.day1},postCfg)
            	      .success(function(data){
            	    	  $scope.day1List = data;
            	      });
                 //获取周二数据
                 $http.post('/watchArrangements/getDayArrange',{'checkDate':$scope.day2},postCfg)
            	      .success(function(data){
            	    	  $scope.day2List = data;
            	      });
                 //获取周三数据
                 $http.post('/watchArrangements/getDayArrange',{'checkDate':$scope.day3},postCfg)
            	      .success(function(data){
            	    	  $scope.day3List = data;
            	      });
                 //获取周四数据
                 $http.post('/watchArrangements/getDayArrange',{'checkDate':$scope.day4},postCfg)
            	      .success(function(data){
            	    	  $scope.day4List = data;
            	      });
                 //获取周五数据
                 $http.post('/watchArrangements/getDayArrange',{'checkDate':$scope.day5},postCfg)
            	      .success(function(data){
            	    	  $scope.day5List = data;
            	      });
                 //获取周六数据
                 $http.post('/watchArrangements/getDayArrange',{'checkDate':$scope.day6},postCfg)
            	      .success(function(data){
            	    	  $scope.day6List = data;
            	      });
                 //获取周日数据
                 $http.post('/watchArrangements/getDayArrange',{'checkDate':$scope.day7},postCfg)
		       	      .success(function(data){
		       	    	  $scope.day7List = data;
		       	      });
             }
             //
             //获取上个页面传回来的值
             var getData = $.query.get("data");
             if(getData == null || getData == ""){
            	 var date = new Date();
                 var year = date.getFullYear();
                 var month = date.getMonth()+1;
                 var day = date.getDate();
                 var currentTime = year+"-"+month+"-"+day;
                 days(currentTime);
                 $http.post('/watchArrangements/getDayArrange',{'checkDate':currentTime},postCfg)
	       	      .success(function(data){
	       	    	  $scope.clickDateList = data;
	       	      });
             }else{
            	 days(getData);
            	 $http.post('/watchArrangements/getDayArrange',{'checkDate':getData},postCfg)
	       	      .success(function(data){
	       	    	  $scope.clickDateList = data;
	       	      });
             }
             //弹出框
             $scope.layerShow = function (flag) {
            	 switch(flag){
            	 case 1:
            		 var url = 'dutyTable.html?date='+$scope.day1;
            		 break;
            	 case 2:
            		 var url = 'dutyTable.html?date='+$scope.day2;
            		 break;
            	 case 3:
            		 var url = 'dutyTable.html?date='+$scope.day3;
            		 break;
            	 case 4:
            		 var url = 'dutyTable.html?date='+$scope.day4;
            		 break;
            	 case 5:
            		 var url = 'dutyTable.html?date='+$scope.day5;
            		 break;
            	 case 6:
            		 var url = 'dutyTable.html?date='+$scope.day6;
            		 break;
            	 case 7:
            		 var url = 'dutyTable.html?date='+$scope.day7;
            		 break;
            	 }
                 var title = "值班表";
                 //var url = 'dutyTable.html';
                 var w = "700px";
                 var h = "500px";
                 layer.open({
                     type:2,
                     title:title,
                     content:url,
                     area:[w,h],
                     shade:false,
                     shadeClose:false,
                     scrollbar: false,
                     closeBtn:2
                 });
             }
         });
</script>
</body>
</html>